#include<bits/stdc++.h>
using namespace std;
using ll=long long;
using Pr=pair<ll,ll>;
#define F(i,l,r) for(ll i=(l);i<=(r);++i)
#define G(i,r,l) for(ll i=(r);i>=(l);--i)
#define pb push_back
#define ct const
#define il inline
#define fi first
#define se second
#define mkr(A,B) make_pair((A),(B))
template<class T>
il void tomn(T&x,T ct&y){if(y<x)x=y;}
template<class T>
il void tomx(T&x,T ct&y){if(x<y)x=y;}
#define dbg(...) fprintf(stderr,__VA_ARGS__)
#define CUT dbg("=========================\n")

ct ll P=998244353;
il void add2(ll&x,ll y){x+=y,x-=((-(x>=P))&P);}
il ll add(ll x,ll y){return add2(x,y),x;}
il void sub2(ll&x,ll y){x-=y,x+=((-(x<=0))&P);}
il ll sub(ll x,ll y){return sub2(x,y),x;}

int main(){
	freopen("clown.in","r",stdin);
	freopen("clown.out","w",stdout);
	int m;scanf("%d",&m);
	F(i,1,m)scanf("%*d");
	ll a,b;scanf("%lld%lld",&a,&b);
	ll x=a*b%P;
	printf("%lld\n",x*(x+P-1)%P*(x+P-2)%P);
}